package mylab.String;

public class StringUtils {
	
	public static String getLinesOfStackTrace(Exception e, int nLines)
	{
		String stackTraces="";
		StackTraceElement[] ste = e.getStackTrace();
		if(ste.length >= nLines)
		{
			for(int i=0; i<nLines; i++)
			{
				stackTraces=stackTraces.concat(ste[i].toString());
			}
		}
		else
		{
			stackTraces=stackTraces.concat(ste[0].toString());
		}
		
		return stackTraces; 
	}

}
